package com.sh.data.engine.domain.integration.offline.model.enums;

/**
 * @Auther: zigui.zdf @Date: 2018/10/12 11:09 @Description:数据源类型定义
 */
public enum OfflineTaskWriterAndDsType {
    mysqlwriter("MySQL"),
    mysql8writer("MySQL8"),
    sqlserverwriter("SQLServer"),
    postgresqlwriter("PostgreSQL"),
    db2writer("DB2"),
    oraclewriter("Oracle"),
    opentsdbwriter("OpenTSDB"),
    gbasewriter("GBase"),
    librawriter("LibrA"),
    carbondatawriter("CarbonData"),
    hivewriter("Hive");

    private String name;

    OfflineTaskWriterAndDsType(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static String getDsType(String name) {
        if (name == null) {
            return null;
        }
        for (OfflineTaskWriterAndDsType value : OfflineTaskWriterAndDsType.values()) {
            if (value.name().equals(name)) {
                return value.getName();
            }
        }

        return null;
    }
}
